package projetobancodedados;

import java.sql.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
/**
 */
public class connectionFactory {
    private Connection conn;
    public connectionFactory(){
        String url = "jdbc:postgresql://localhost:5432/postgres";
        String username = "postgres";
        String pass = "postgres";
        
        try{
            Class.forName("org.postgresql.Driver");
            
            conn = DriverManager.getConnection(url,username,pass);
            System.out.println("OK!");
        }catch(Exception e){
            e.printStackTrace();
        }
    }
    
    public Connection getConnection(){
        return conn;
    }
}
